package com.wp.admin.controller;

import com.wp.admin.pojo.SysDept;
import com.wp.admin.service.SysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author wp
 * @create 2019-03-06 9:20
 */
@RestController
@RequestMapping("dept")
public class SysDeptController {

    @Autowired
    private SysDeptService sysDeptService;

    @GetMapping("/findTree")
    public ResponseEntity<List<SysDept>> findTree(){
        return ResponseEntity.ok(sysDeptService.findTree());
    }

}
